package androidx.test.espresso;

import android.os.Looper;
import androidx.test.espresso.core.internal.deps.guava.base.Joiner;
import androidx.test.espresso.core.internal.deps.guava.base.Preconditions;
import java.util.List;

/* loaded from: classes.dex */
public final class AppNotIdleException extends RuntimeException implements EspressoException {
    private AppNotIdleException(String description) {
        super(description);
    }

    @Deprecated
    public static AppNotIdleException create(List<String> idleConditions, int loopCount, int seconds) {
        Preconditions.checkState(Looper.myLooper() == Looper.getMainLooper());
        return new AppNotIdleException(String.format("App not idle within timeout of %s seconds evenafter trying for %s iterations. The following Idle Conditions failed %s", Integer.valueOf(seconds), Integer.valueOf(loopCount), Joiner.on(",").join(idleConditions)));
    }

    public static AppNotIdleException create(List<String> idleConditions, String message) {
        return new AppNotIdleException(String.format("%s The following Idle Conditions failed %s.", message, Joiner.on(",").join(idleConditions)));
    }
}
